package sigapp.hvz.MenuSys;


import sigapp.hvz.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

public class Login extends Activity implements OnClickListener
{
	static int numb;
	
	//layout
	View loginButton;
	View exitButton;
	
	View signs;
	View log_input; 
	TextView id_in;
	TextView pw_in;
	View log_btn;
	View can_btn;
	//layout
	
	//animation
    Animation tilt_anim;// = AnimationUtils.loadAnimation(this, R.anim.click_rotate);
    Animation push_anim;
    Animation shake_anim;
    //animation
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        
        loginButton = findViewById(R.id.login_button);
        loginButton.setOnClickListener(this);
        exitButton = findViewById(R.id.exit_button);
        exitButton.setOnClickListener(this);
        
        signs = findViewById(R.id.RelativeLayoutSigns);
        log_input = findViewById(R.id.RelativeLayoutLogin);
        id_in = (TextView)findViewById(R.id.EditTextId);
        pw_in = (TextView)findViewById(R.id.EditTextPw);
        log_btn = (View)findViewById(R.id.Button01);
        log_btn.setOnClickListener(this);
        can_btn = (View)findViewById(R.id.Button02);
        can_btn.setOnClickListener(this);
        //log_input.setVisibility(4);
        
        tilt_anim = AnimationUtils.loadAnimation(this, R.anim.click_rotate);
        push_anim = AnimationUtils.loadAnimation(this, R.anim.click_shade);
        shake_anim = AnimationUtils.loadAnimation(this, R.anim.anim_shake);
        //shake_anim.setRepeatMode(1);
        //shake_anim.setRepeatCount(-1);
        //signs.set
        signs.startAnimation(shake_anim);
        
        //AnimationDrawable fogAnimation;
        //ImageView fogImage = (ImageView) findViewById(R.id.ImageView02);
        //fogImage.setBackgroundResource(R.drawable.animlist_fog);
        //fogAnimation = (AnimationDrawable) fogImage.getBackground();
        
        //fogAnimation.start();
        
    }
    
	public void onClick(View v) 
	{
		switch(v.getId())
		{
		case R.id.login_button:
			loginButton.startAnimation(tilt_anim);
			log_input.setVisibility(0);
			break;
		
		case R.id.Button01:
			//numb = 369;
			log_btn.startAnimation(push_anim);
			Intent i = new Intent(this, Menus.class);
			startActivity(i);
			break;
			
		case R.id.Button02:
			//can_btn.startAnimation(push_anim);
			log_input.setVisibility(4);
			break;

		case R.id.exit_button:
			exitButton.startAnimation(tilt_anim);
			//fogAnimation.start();
			finish();
			break;
		//more buttons
		}
	}
}